package List接口;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;

/**
 * @author Administrator
 * @ClassName ListTest1
 * @TIME 星期二 2020/12/29
 */
public class ListTest1 {
    public static void main(String[] args) {
        Collection<String> c = new ArrayList<>();
        c.add("JAVA YES");
        c.add("C++ YES");
        c.add("PHP YES");

        List<String> list = new ArrayList<>();
        list.add(0, "List");
        list.add(1, "List2");
        //0，插入YES
        list.set(0,"YES");
        list.addAll(2, c);
        Object[] str2 = list.toArray();
        System.out.println("数组： "+Arrays.toString(str2));
        System.out.println("REMOVE: "+ list.remove(2));
        System.out.println("subLIST: "+list.subList(0,list.size()));
        System.out.println("list.get() : " + list.get(2));
    }
}
